Financial Data Analysis
with ChatGPT





Kerry Back

ChatGPT Plugins

  • ChatGPT-4 interacts with plugins, expanding its capabilities
  • OpenAI provides Code Interpreter
  • Third party plugins include Noteable

Conversation 1: Moving Averages

Moving averages

  • There is a long history of looking at moving averages to try to predict stock returns.
  • Moving average = average over a moving window: last 20 days or last 50 days or whatever.
  • If a stock is above or below a moving average, or crosses a moving average from above or below, it could be a bullish or bearish sign.

Crude Prices and Moving Averages

Conversation 2: Autocorrelations

Autocorrelation

  • Autocorrelation is the correlation of a variable with its own lagged values.
    • At lag 1: does today predict tomorrow? does this month predict next month?
    • At lag 2: does yesterday predict tomorrow? etc.
  • Applied to % changes: does today’s % change predict tomorrow’s % change? etc.
    • Positive autocorrelation \(\Rightarrow\) momentum, negative \(\Rightarrow\) reversals

ARMA(1, 1)

  • Model is

\[x_t = a + b x_{t-1} + \varepsilon_t + c \varepsilon_{t-1}\]

  • \(\varepsilon_t\) are random shocks
  • \(b\) is the autoregressive (AR) coefficient at lag 1
  • \(c\) is the moving average (MA) coefficient at lag 1

Autocorrelation and ARMA

Conversation 3: Long Short Term Memory

Long Short Term Memory

  • An LSTM model is a type of recurrent neural network.
  • It is widely used for predicting time series data.
  • We’ll use the Noteable plugin, because it allows us to install libraries.

Training and Testing an LSTM Model

Conversation 4: Financial Statements

  • The key financial statements are
    • income statement
    • balance sheet
    • statement of cash flows
  • The past 5 years are available at finance.yahoo.com.

CVX and COP Financial Statements